package jaux.tank.bean.dto;

import jaux.tank.bean.entity.system.EntityExtension;
import lombok.Data;

@Data
public class EntityExtensionDto implements EntityDto<EntityExtension> {

	private String id;
	
	private String entity;

	private String entityId;

	private String name;

	private String value;

	private Integer no;

	public EntityExtensionDto() {
	}

	public EntityExtensionDto(EntityExtension entity) {
		copyEntity(entity);
	}

	@Override
	public void copyEntity(EntityExtension entity) {

		this.id = entity.getId();
		this.entity = entity.getEntity();

		this.entityId = entity.getEntityId();

		this.name = entity.getName();

		this.value = entity.getValue();

		this.no = entity.getNo();

	}

	@Override
	public EntityExtension toEntity() {
		EntityExtension entityExt = new EntityExtension();
		entityExt.setId(entityId);
		entityExt.setEntity(entity);
		entityExt.setEntityId(entityId);
		entityExt.setName(name);
		entityExt.setValue(value);
		entityExt.setNo(no);
		return entityExt;
	}

}
